﻿namespace AesDemo
{
    public interface IRSAManager
    {
        /// <summary>
        /// 生成私钥
        /// </summary>
        /// <returns>私钥base64字符串</returns>
        string CreatePrivateKey();
        /// <summary>
        /// 生成私钥
        /// </summary>
        /// <param name="dwKeySize">私钥位数</param>
        /// <returns>私钥base64字符串</returns>
        string CreatePrivateKey(int dwKeySize);

        /// <summary>
        /// 获取公钥
        /// </summary>
        /// <param name="priKey">私钥base64字符串</param>
        /// <returns>公钥base64字符串</returns>
        string GetPublicKey(string priKey);
        /// <summary>
        /// 签名数据
        /// </summary>
        /// <param name="priKey">私钥字符串</param>
        /// <param name="data">待签名内容</param>
        /// <returns>签名后字符串</returns>
         string SignData(string priKey, string data);
        /// <summary>
        /// 验证签名
        /// </summary>
        /// <param name="pubKey">公钥字符串</param>
        /// <param name="signedData">签名后字符串</param>
        /// <param name="data">待验证签名内容</param>
        /// <returns>是否验证通过</returns>
        bool VerifySignedData(string pubKey, string signedData, string data);
    }
}
